//
//  SE_LeftMenu_VC.m
//  SkyEye
//
//  Created by dllo on 16/8/9.
//  Copyright © 2016年 SE. All rights reserved.
//

#import "SE_LeftMenu_VC.h"
#import "RESideMenu.h"
#import "SE_Select_VC.h"
#import "SE_My_VC.h"
#import "SE_Find_VC.h"
#import "SE_Author_VC.h"

@interface SE_LeftMenu_VC ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic, retain) UITableView *tableView;

@end

@implementation SE_LeftMenu_VC

- (void)viewDidLoad {
    [super viewDidLoad];

    [self createTableView];
    self.view.backgroundColor = [UIColor clearColor];
}

-(void)createTableView
{
    self.tableView =  [[UITableView alloc] initWithFrame:CGRectMake(50, self.view.frame.size.height * 0.3, self.view.frame.size.width, 50 * 6) style:UITableViewStylePlain];
    
    self.tableView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth;
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.opaque = NO;
    self.tableView.backgroundColor = [UIColor clearColor];
    self.tableView.backgroundView = nil;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.bounces = NO;
    [self.view addSubview:self.tableView];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    switch (indexPath.row) {
        case 0:
            [self.sideMenuViewController setContentViewController:[[UINavigationController alloc] initWithRootViewController:[[SE_Select_VC alloc] init]]animated:YES];
            [self.sideMenuViewController hideMenuViewController];
            break;
        case 1:
            [self.sideMenuViewController setContentViewController:[[UINavigationController alloc] initWithRootViewController:[[SE_Find_VC alloc] init]]animated:YES];
            [self.sideMenuViewController hideMenuViewController];
            break;
            
        case 2:
            [self.sideMenuViewController setContentViewController:[[UINavigationController alloc] initWithRootViewController:[[SE_Author_VC alloc] init]]animated:YES];
            [self.sideMenuViewController hideMenuViewController];
            break;
        case 3:
            [self.sideMenuViewController setContentViewController:[[UINavigationController alloc] initWithRootViewController:[[SE_My_VC alloc] init]]animated:YES];
            [self.sideMenuViewController hideMenuViewController];
            break;
        default:
            break;
    }
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 54;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    cell.textLabel.font = [UIFont systemFontOfSize:21];
    cell.textLabel.textColor = [UIColor whiteColor];
    cell.selectedBackgroundView = [[UIView alloc]init];
    cell.backgroundColor = [UIColor clearColor];
    NSArray *titles = @[@"精选", @"发现", @"作者", @"我的"];
    cell.textLabel.text = titles[indexPath.row];
    return cell;
}


@end


















